refactor(react/transform): MTS js_fns_to_extract to make props keys and values accessible#672
Conversation
|
js_fns_to_extract to use HashMap for better managementjs_fns_to_extract to use HashMap
CodSpeed Performance ReportMerging #672 will not alter performanceComparing Summary
|
… and values accessible
dc7d0b8 to
5912ce4
Compare
js_fns_to_extract to use HashMapjs_fns_to_extract to make props keys and values accessible
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the handling of worklet function extraction in the MTS transform by changing the representation of extracted JavaScript functions from a Box to a vector of key-value pairs.
- Changed types for js and extracted function expressions to Vec<(IdentName, Box)>.
- Updated checks and iterations to accommodate the new vector-based structure.
- Adjusted the VisitMut implementation in extract_ident to collect function expressions as tuples.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/react/transform/src/swc_plugin_worklet/gen_stmt.rs | Updates to handle extracted_js_fns as a vector and rebuild the object literal for worklet transformation. |
| packages/react/transform/src/swc_plugin_worklet/extract_ident.rs | Changes js_fns_to_extract type handling, including using take() and updating the collection process in VisitMut. |
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. 📢 Thoughts on this report? Let us know! |
Bundle ReportBundle size has no change ✅ |
… and values accessible (#672) ## Summary Refactor MTS `js_fns_to_extract` to make props keys and values accessible. ## Checklist - [x] Tests updated (or not required). - [x] Documentation updated (or not required).
Summary
Refactor MTS
js_fns_to_extractto make props keys and values accessible.Checklist